/*
 * @Author: Jiraiya
 * @Date: 2020-04-29 19:10:13
 * @LastEditors: Jiraiya
 * @LastEditTime: 2020-04-29 19:26:25
 * @Description: 
 */
'use strict';

const Redis = require('ioredis');
const {redisConfig} = require('./config');
module.exports = function(app){

    let client = null;

    if( redisConfig.isCluster ){
        client = new Redis.Cluster(redisConfig.clusterServer, redisConfig.clusterOptions);
    }else{
        client = new Redis(redisConfig.options);
    }

    return client;
  
};